<%--
  Created by cofey on 16/6/14.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/decorators/tag.jsp" %>
<!DOCTYPE html>
<html>
<head lang="zh">
    <meta charset="UTF-8">
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'/>
    <title>登录 - 配置中心</title>
    <link href="${root}/resources/images/yunji.ico" rel="shotcut icon"/>
    <link href="${root}/resources/css/login.css" rel="stylesheet"/>
</head>
<body>
<header>
    <div class="text">
        <a><em>&nbsp;</em>&nbsp;<span>&nbsp;</span></a>
    </div>
</header>
<div id="content">
    <img src="${root}/resources/images/logo.png" width="109" height="90"/>
    <h1>配置中心登录</h1>
    <form>
        <input id="usename" name="username" type="text" value=""/><br/>
        <input id="password" name="password" type="password" value=""/>
        <div class="bt clear">
            <input id="submit" type="button" onclick="login();" value="登录"/>
        </div>
    </form>
</div>
<div id="footer">
    <p><span>© 2014-2017 XXXX有限公司，并保留所有权利。</span></p>
</div>

<script src="${root}/resources/js/jquery.min.js"></script>
<script src="${root}/resources/js/global.js"></script>
<script type="text/javascript">
    $(function () {
        $('#password').keypress(function (event) {
            var keycode = (event.keyCode ? event.keyCode : event.which);
            if (keycode == '13') {
                login();
            }
        });
    });
    function login() {
        var account = $("#usename").val();
        var password = $("#password").val();
        if (isEmpty(account)) {
            layer.tips("账号不能为空", "#usename");
            return;
        }
        if (isEmpty(password)) {
            layer.tips("密码不能为空", "#password");
            return;
        }
        window.location.href = "${root}/index.html";
    }
</script>
</body>
</html>